

#ifndef VertexPositionColorTexture_h
#define VertexPositionColorTexture_h

#include <Defines.h>

// Riccsson includes.
#include <System/Object.h>
#include <System/ArgumentException.h>
#include <System/Array.h>

// XNA includes.
#include "../../RMatrix.h"
#include "../../Vector2.h"
#include "../../Vector3.h"
#include "../../Color.h"
#include "IVertexType.h"
#include "VertexDeclaration.h"

namespace Riccsson
{
	namespace Xna
	{
		namespace Framework
		{
			namespace Graphics
			{
                struct VertexPositionColorTexture : public System::Object, public IVertexType
                {
                    public: Vector3 Position;
                    public: Color color;
                    public: Vector2 TextureCoordinate;
                    public: static /*readonly*/ GC_PTR<VertexDeclaration> vertexDeclaration;

					public: VertexPositionColorTexture()
                    {
                    }

					// Copy constructor.
					public: VertexPositionColorTexture(const VertexPositionColorTexture& other)
                    {
						Position = other.Position;
						color = other.color;
						TextureCoordinate = other.TextureCoordinate;
                    }

                    public: VertexPositionColorTexture(const Vector3& position, const Color& color_, const Vector2& textureCoordinate)
                    {
                        Position = position;
                        color = color_;
                        TextureCoordinate = textureCoordinate;
                    }
		
					public: override PROP3_GET(GC_PTR<VertexDeclaration>, vertexDeclaration)
                    {
                         return vertexDeclaration;
                    }

                    public: override int GetHashCode()
                    {
                        // TODO: FIc gethashcode
                        return 0;
                    }

				    public: override GC_PTR<Riccsson::System::string> ToString()
                    {
                        //return string.Format("{{Position:{0} Color:{1} TextureCoordinate:{2}}}", new object[] { this.Position, this.Color, this.TextureCoordinate });
                        throw;
                    }

				    public: override bool Equals(const Riccsson::System::object* obj)
                    {
                        //if (obj == null)
                        //    return false;
                        //
                        //if (obj->GetType() != Riccsson::System::Object::GetType())
                        //    return false;
                        //
                        //return (this == ((VertexPositionColorTexture*)obj));
                        throw;
                    }

					// TODO: Implement this in a static constructor.

					REGISTER_CLASS(VertexPositionColorTexture)
                };
                
                //bool operator ==(const VertexPositionColorTexture& left, const VertexPositionColorTexture& right);
                //bool operator !=(const VertexPositionColorTexture& left, const VertexPositionColorTexture& right);
				inline bool operator ==(const VertexPositionColorTexture& left, const VertexPositionColorTexture& right)
				{
					return (((left.Position == right.Position) && (left.color == right.color)) && (left.TextureCoordinate == right.TextureCoordinate));
				}

				inline bool operator !=(const VertexPositionColorTexture& left, const VertexPositionColorTexture& right)
				{
					return !( (((left.Position == right.Position) && (left.color == right.color)) && (left.TextureCoordinate == right.TextureCoordinate)) );
				}
            }
		}
	}
}

#endif